package com.cizzy.favorite.feign;

import com.cizzy.favorite.common.Result;
import com.cizzy.favorite.entity.dao.UserCountDAO;
import com.cizzy.favorite.entity.dto.VideoDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@FeignClient("user-server-service")
public interface UserFeign {
    /**
     * 通过ID 数组查找相应的视频数组
     *
     * @param videoIds 视频ID 集合
     * @return 视频集合
     */
    @PostMapping("/user/getUserListByIds")
    Result<List<VideoDTO>> getUserListByIds(@RequestBody List<Long> videoIds);

    @ResponseBody
    @PostMapping("/userCount/addUserCountById")
    Result<UserCountDAO> addUserCountById(@RequestParam("column") String column, @RequestParam("id") Long id, @RequestParam("count") Integer count);
}
